<template>
  <div class="study-page">
    <div class="cl-module course-user-list">
      <ul>
        <li class="rel">编号</li>
        <li class="draw">学员</li>
        <li>签到</li>
        <li>作业</li>
      </ul>
      <br>
      <hr>
      <div class="apply">
        <ul v-for="user in list">
          <li class="rel">
            {{user.number}}
          </li>
          <li class="draw">
            <span>
              <img :src="user.avatar">
            </span>
            <span class="name">{{user.nickname}}</span>
          </li>
          <li>
            {{user.sign_in ? '√' : '-'}}
          </li>
          <li>
            {{user.homework ? '√' : '-'}}
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {
  Tabbar,
  Cell,
  Group,
  Badge
} from 'vux'
// const version = require('../package.json').version
export default {
  components: {
    Tabbar,
    Cell,
    Group,
    Badge
  },
  data () {
    return {
      id: 0,
      list: []
    }
  },
  created () {
    var id = parseInt(this.$route.params.id)
    if (isNaN(id) || id < 0) {
      id = 0
    }
    this.id = id
    this.$api.course.courseUserList(id).then((data) => {
      this.list = data.list
    })
  }
}
</script>

<style scoped lang="scss">
.course-user-list ul{
  list-style: none;
  text-align: center;
  li{
    float:left;
    height: 30px;
    margin-top: 15px;
    margin-bottom: 10px;
    width: 20%;
    color:#6c7b8a;
    overflow: hidden;
  }
  li.draw{
    width:40%;
  }
}
.draw{
  img{
    height: 24px;
    width: 24px;
    margin-right: 15px;
  }
  span{
    width: 40%;
    text-align: center;
  }
  .name{
    position: relative;
    font-size:14px;
    top: -7px;
    width: 60%;
  }
}
hr{
  margin: 30px 30px 0 30px;
  opacity: 0.3;
}
</style>
